Skip to content

feat: add output guardrails workflow for processing#133

Merged
ssdeanx merged 1 commit intomainfrom
develop
Apr 15, 2026
Merged

feat: add output guardrails workflow for processing#133
ssdeanx merged 1 commit intomainfrom
develop

Conversation

@ssdeanx
Copy link
Copy Markdown
Owner

@ssdeanx ssdeanx commented Apr 15, 2026

  • Introduced a new workflow outputGuardrails in output-guardrails.ts to enhance output processing.
  • Implemented a sequential processing flow:
    • Added a TokenLimiterProcessor to limit tokens to a maximum of 256,000.
    • Included a BatchPartsProcessor to batch stream chunks with a size of 10, emitting on non-text.
  • Added parallel processing for independent checks:
    • Integrated a PIIDetector with a redaction strategy using the model openrouter/google/gemma-4-31b-it:free.
    • Integrated a ModerationProcessor with a blocking strategy using the same model.
  • Mapped the output to retain transformed messages from the PIIDetector.
  • Added a sequential step for SystemPromptScrubber to scrub the output based on the previous redaction, using a placeholder text of [REDACTED].

- Introduced a new workflow `outputGuardrails` in `output-guardrails.ts` to enhance output processing.
- Implemented a sequential processing flow:
  - Added a `TokenLimiterProcessor` to limit tokens to a maximum of 256,000.
  - Included a `BatchPartsProcessor` to batch stream chunks with a size of 10, emitting on non-text.
- Added parallel processing for independent checks:
  - Integrated a `PIIDetector` with a redaction strategy using the model `openrouter/google/gemma-4-31b-it:free`.
  - Integrated a `ModerationProcessor` with a blocking strategy using the same model.
- Mapped the output to retain transformed messages from the `PIIDetector`.
- Added a sequential step for `SystemPromptScrubber` to scrub the output based on the previous redaction, using a placeholder text of `[REDACTED]`.
Copilot AI review requested due to automatic review settings April 15, 2026 13:21
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @ssdeanx, your pull request is larger than the review limit of 150000 diff characters

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-stack Error Error Apr 15, 2026 1:27pm

@github-actions
Copy link
Copy Markdown

🤖 Hi @ssdeanx, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions
Copy link
Copy Markdown

🤖 I'm sorry @ssdeanx, but I was unable to process your request. Please see the logs for more details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Caution

Review failed

Pull request was closed or merged during review

Summary by CodeRabbit

  • New Features

    • Modularized chat settings with dedicated routes for profile, security, sessions, API keys, and admin controls
    • Enhanced authentication with streamlined Google One Tap integration and improved callback handling
    • Improved workspace management with normalized data handling and state persistence
  • Bug Fixes

    • Fixed validation errors in incomplete message states
    • Corrected hydration-related UI mismatches on login and signup
    • Improved credential handling for cross-origin requests
  • Improvements

    • Updated agent models for better performance across multiple operations
    • Enhanced supervisor scoring with standardized pattern-based evaluation
    • Refined browser agent verification workflow

Walkthrough

Large-scale refactor introducing modular chat settings routes, UI improvements (resizable sidebars, tooltips), scorer framework migration, browser runtime configuration hardening, and authentication standardization across agents, networks, hooks, and components. Multiple pages wrap into shared ChatPageShell with ChatProvider; user/admin settings split into dedicated sub-routes; and extensive scorer implementations migrate to declarative supervisor-pattern approach.

Changes

Cohort / File(s) Summary
Environment & Config
.env.example, src/mastra/auth.ts
Updated Better Auth URL from HTTPS to HTTP; added NEXT_PUBLIC_BETTER_AUTH_URL and NEXT_PUBLIC_GOOGLE_CLIENT_ID for client-side use; normalized Google OAuth callback path to /api/auth/callback/google; improved redirect URI resolution with validation logging.
Chat Settings Modularization
app/chat/user/_components/user-settings-panel.tsx, app/chat/user/layout.tsx, app/chat/user/page.tsx, app/chat/user/*/page.tsx, app/chat/admin/_components/admin-management-panel.tsx, app/chat/admin/layout.tsx, app/chat/admin/page.tsx, app/chat/admin/*/page.tsx
Created new ChatSettingsShell component for consistent settings UI; added section-aware UserSettingsPanel and AdminSettingsPanel to conditionally render panels; introduced layout components and dedicated pages for each settings section (profile, security, sessions, api-keys, danger-zone for user; runtime, users for admin); replaced monolithic settings pages with overview cards linking to focused sub-routes.
Chat Shell & Layout
app/chat/components/chat-settings-shell.tsx, app/chat/components/chat-page-shell.tsx, app/chat/layout.tsx
Introduced ChatSettingsShell wrapper for modular settings routes with scrollable nav; added hideHeader prop to ChatPageShell; wrapped layout in Suspense for session checking; adjusted padding/responsive styling.
Chat Pages Integration
app/chat/dataset/page.tsx, app/chat/evaluation/page.tsx, app/chat/harness/page.tsx, app/chat/logs/page.tsx, app/chat/mcp-a2a/page.tsx, app/chat/observability/page.tsx, app/chat/tools/page.tsx, app/chat/workflows/page.tsx, app/chat/workflows/[workflowId]/page.tsx, app/chat/workspaces/page.tsx
Wrapped all dashboard pages in ChatProvider and ChatPageShell with MainSidebar for consistent layout; set hideHeader and contentClassName="p-0" for unified styling.
Main Sidebar & Messaging
app/chat/components/main-sidebar.tsx, app/chat/components/chat-messages.tsx, app/chat/components/chat-sidebar.tsx
Added comprehensive tooltip wrappers, scrollable areas, and page item descriptions in sidebar; refactored thought-summary extraction to use provider-agnostic extractThoughtSummaryFromProviderMetadata helper; added vector store selection flow and badge display; improved message validation debouncing.
Chat Layout Resizability
app/chat/components/chat-layout.tsx
Replaced fixed two-column layout with ResizablePanelGroup for draggable sidebar resizing; hidden on non-xl screens; focus mode now omits sidebar panel entirely.
Login & Auth
app/login/page.tsx, app/login/signup/page.tsx, lib/auth-client.ts
Added Suspense boundaries and isHydrated gates to prevent hydration mismatches; replaced direct authClient calls with new helpers (startGoogleOneTap, signInWithUsername, signUpWithUsername); added hasGoogleOneTapClient flag and NEXT_PUBLIC_BETTER_AUTH_URL support.
Mastra Core Hooks
lib/hooks/use-mastra-query.ts, lib/hooks/use-persistent-store.ts
Normalized useWorkspaces() to return WorkspaceItem[] directly; changed useVectorIndexes default from pgVector to libsqlvector; updated usePersistentStore to use functional state updaters for compatibility.
Chat Providers & Transports
app/chat/providers/chat-context.tsx, app/networks/providers/network-context.tsx, app/workflows/providers/workflow-context.tsx, app/chat/components/nested-agent-chat.tsx
Added credentials: 'include' to DefaultChatTransport for cross-origin SSE; refactored resource/thread ID initialization from direct state to useMemo-derived overrides; tightened message validation to skip incomplete messages.
Browser Runtime Configuration
src/mastra/browsers.ts
Centralized browser lifecycle, headless mode, timeout, and CDP URL into env-driven configuration; introduced browserRuntimeConfig export; added typed browser profiles and lifecycle hooks; refactored Stagehand connection resolution (CDP vs Browserbase mode); updated system prompts.
Agent Model & Provider Updates
src/mastra/agents/... (15+ files)
Systematized model selection across agents: replaced gemini-3.1-flash-lite-preview with gemma-4-31b-it for consistency; added responseModalities: ['TEXT', 'IMAGE'] to Google providers; disabled TokenLimiterProcessor across multiple agents; updated browser/editor/calendar/content-strategist and other agent configs.
Supervisor Scorer Migration
src/mastra/scorers/supervisor-scorers.ts
Introduced new createSupervisorPatternScorer, createSupervisorAgentPatternScorer, createSupervisorChannelPatternScorer, and createStructuredOutputSupervisorPatternScorer factories; replaces imperative scorer pipelines with declarative pattern-based configuration (signals, weights, thresholds, reasons).
Agent & Network Scorer Consolidation
src/mastra/agents/... (10+ agent files), src/mastra/networks/... (12+ network files)
Migrated all createScorer implementations across agents (customer-support, SEO, social-media, project-management, translation, etc.) and networks (business-intelligence, coding-team, content-creation, data-pipeline, devops, financial, learning, marketing, report-generation, research-pipeline, security) to createSupervisorPatternScorer; removed bespoke preprocess/analyze logic in favor of declarative signal/weight configuration.
Browser Agent & Research Hardening
src/mastra/agents/browserAgent.ts, src/mastra/agents/researchAgent.ts, src/mastra/agents/supervisor-agent.ts
Enhanced browser agent instructions to "verification specialist" role with explicit operating rules; refactored research agent to use inline channel adapters with conditional GitHub support and centralized event handlers; updated supervisor agent to delegate browser verification steps and support model role-based selection.
Business Logic Agents
src/mastra/agents/businessLegalAgents.ts, src/mastra/agents/calendarAgent.ts, src/mastra/agents/recordsAgent.ts, src/mastra/agents/graphingAgents.ts, src/mastra/agents/image.ts, src/mastra/agents/recharts.ts, src/mastra/agents/reportAgent.ts, src/mastra/agents/dane.ts
Disabled token-limiter processors; updated model selections to gemma-4-31b-it; added image modality support to multiple agents; adjusted input processor configurations.
Workflow & Processors
src/mastra/processors/output-guardrails.ts, src/mastra/index.ts, src/mastra/config/libsql.ts
Added new outputGuardrails processor workflow with token limiting, PII detection, moderation, and system-prompt scrubbing; registered browserAgent in Mastra instance; adjusted LibSQL embedder concurrency settings and logging.
Documentation & Memory
README.md, app/chat/AGENTS.md, src/mastra/agents/AGENTS.md, src/mastra/networks/AGENTS.md, memory-bank/activeContext.md, memory-bank/progress.md
Added asset image; documented new chat settings shell design pattern and section-aware panel usage; updated agent best practices for supervisor-scorer conventions and browser delegation; recorded routing/auth/hardening changes and model standardization.
Project Configuration
.gitignore, package.json
Updated gitignore rules for Stakpak, Mastra, Playwright, and dev artifacts; added zlib-sync@^0.1.10 dependency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ChatPageShell
    participant ChatProvider
    participant MainSidebar
    participant ChatMessages
    participant Transport

    User->>ChatPageShell: Navigate to dashboard/settings page
    ChatPageShell->>ChatProvider: Initialize context
    ChatProvider->>Transport: Create DefaultChatTransport with credentials:'include'
    ChatPageShell->>MainSidebar: Render sidebar with tooltips
    MainSidebar->>MainSidebar: Load workspaces, threads, vectors
    User->>ChatMessages: Load or send message
    ChatMessages->>ChatProvider: Extract thought summary from metadata
    ChatProvider->>Transport: Send request with SSE credentials
    Transport-->>ChatMessages: Stream response chunks
    ChatMessages->>ChatMessages: Validate complete messages, skip incomplete
    ChatMessages-->>User: Render thought summary & message content
Loading
sequenceDiagram
    participant User
    participant UserPage (Overview)
    participant UserSettingsLayout
    participant ChatSettingsShell
    participant UserSettingsPanel
    participant BetterAuth

    User->>UserPage: Navigate to /chat/user
    UserPage->>UserPage: Render section cards (Profile, Security, Sessions, etc.)
    User->>UserPage: Click "Profile" card
    UserPage-->>User: Navigate to /chat/user/profile
    UserSettingsLayout->>ChatSettingsShell: Initialize with sections nav
    ChatSettingsShell->>ChatSettingsShell: Highlight active section path
    ChatSettingsShell->>UserSettingsPanel: Render with section="profile"
    UserSettingsPanel->>BetterAuth: Load profile data
    BetterAuth-->>UserSettingsPanel: Return user profile
    UserSettingsPanel-->>User: Render profile-only form
    User->>UserSettingsPanel: Submit profile changes
    UserSettingsPanel->>BetterAuth: Update via Better Auth mutation
    BetterAuth-->>UserSettingsPanel: Confirm update
    UserSettingsPanel-->>User: Show success message
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • Develop #96 — Modifies message-part extraction and summary helpers in chat-messages.tsx, overlapping with thought-summary extraction refactoring in this PR.
  • Develop #93 — Overlaps on Mastra agent and network configuration changes, including scorer implementations and agent model updates.
  • feat: Add new networks and workflows for enhanced functionality #68 — Modifies the same network modules (business-intelligence, content-creation, security networks) undergoing scorer migration.

Suggested reviewers

  • sourcery-ai

🐰 Whiskers bounces with glee,
Chat settings now modular and free!
Scorers sing patterns so clear,
Browsers run hardened without fear,
One Shell to bind them—hooray for this spree! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Mastra processor workflow (outputGuardrails) intended to enforce output guardrails (token limiting, batching, PII redaction, moderation, and prompt scrubbing), and also includes broad refactors across Mastra networks/agents plus multiple chat/auth UI hardening updates.

Changes:

  • Added a new outputGuardrails processor workflow that chains token limiting + batching, runs PII/moderation checks in parallel, and then scrubs system prompts.
  • Standardized many coordinator networks (and some agents) to use the shared createSupervisorPatternScorer(...) / createSupervisorAgentPatternScorer(...) primitives instead of duplicating scorer plumbing.
  • Updated auth + chat UI surfaces (Better Auth redirect normalization, modular settings routes/shell, chat transport credentials, sidebar/workspace normalization), plus added zlib-sync dependency and updated ignore/docs artifacts.

Reviewed changes

Copilot reviewed 97 out of 100 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/mastra/processors/output-guardrails.ts Adds new output guardrails workflow (token limit, batching, PII/moderation, scrubbing).
src/mastra/networks/securityNetwork.ts Migrates local completion scorers to createSupervisorPatternScorer.
src/mastra/networks/marketingAutomationNetwork.ts Migrates network scorers to shared supervisor scorer primitive.
src/mastra/networks/learningNetwork.ts Migrates network scorers to shared supervisor scorer primitive.
src/mastra/networks/index.ts Migrates primary network scorers to shared supervisor scorer primitive.
src/mastra/networks/financialIntelligenceNetwork.ts Migrates network scorers to shared supervisor scorer primitive.
src/mastra/networks/devopsNetwork.ts Migrates network scorers to shared supervisor scorer primitive.
src/mastra/networks/dataPipelineNetwork.ts Migrates network scorers to shared supervisor scorer primitive.
src/mastra/networks/contentCreationNetwork.ts Migrates network scorers to shared supervisor scorer primitive.
src/mastra/networks/codingTeamNetwork.ts Migrates network scorers to shared supervisor scorer primitive.
src/mastra/networks/AGENTS.md Updates network guidance to prefer shared scorer primitives while keeping local signals.
src/mastra/index.ts Registers browserAgent in Mastra agent registry.
src/mastra/config/libsql.ts Adjusts memory/embedder options and logging for LibSQL-backed memory/vector.
src/mastra/auth.ts Normalizes Google redirect URI + trusted origins; refactors provider env handling.
src/mastra/agents/webResearchAgent.ts Removes unused processor import(s).
src/mastra/agents/weather-agent.ts Removes unused imports / token limiter wiring.
src/mastra/agents/translationAgent.ts Migrates scorers to createSupervisorAgentPatternScorer.
src/mastra/agents/stockAnalysisAgent.ts Removes/disabled output token limiter usage.
src/mastra/agents/scriptWriterAgent.ts Removes/disabled output token limiter usage.
src/mastra/agents/researchPaperAgent.ts Removes/disabled output token limiter usage.
src/mastra/agents/researchAgent.ts Adds env-gated GitHub channel adapter, handler refactor, model selection changes, tool search processor.
src/mastra/agents/reportAgent.ts Changes model selection; removes output token limiter.
src/mastra/agents/recharts.ts Adjusts models; removes/disabled token limiter usage.
src/mastra/agents/package-publisher.ts Removes/disabled output token limiter usage.
src/mastra/agents/noteTakerAgent.ts Updates model selection.
src/mastra/agents/learningExtractionAgent.ts Removes/disabled output token limiter usage.
src/mastra/agents/index.ts Exports browserAgent.
src/mastra/agents/image_to_csv.ts Removes/disabled output token limiter usage.
src/mastra/agents/image.ts Updates model selection.
src/mastra/agents/graphingAgents.ts Adjusts Unicode normalizer settings and removes/disabled token limiter usage.
src/mastra/agents/excalidraw_validator.ts Updates model + modalities; removes/disabled output token limiter usage.
src/mastra/agents/editorAgent.ts Updates model + modalities.
src/mastra/agents/documentProcessingAgent.ts Removes/disabled output token limiter usage.
src/mastra/agents/dataExportAgent.ts Removes/disabled output token limiter usage.
src/mastra/agents/dane.ts Updates models + modalities.
src/mastra/agents/contentStrategistAgent.ts Updates model + modalities.
src/mastra/agents/calendarAgent.ts Updates model selection.
src/mastra/agents/businessLegalAgents.ts Removes/disabled output token limiter usage.
src/mastra/agents/browserAgent.ts Adds stronger deterministic browser-verification contract + default options.
src/mastra/agents/AGENTS.md Updates agent conventions (shared scorer primitives, browser/channel guidance).
package.json Adds zlib-sync dependency.
package-lock.json Locks zlib-sync and updates lockfile contents.
memory-bank/progress.md Adds progress updates documenting various changes.
memory-bank/activeContext.md Adds active context updates documenting various changes.
lib/hooks/use-persistent-store.ts Adjusts store setState calls to satisfy overloads (functional updater).
lib/hooks/use-mastra-query.ts Normalizes workspace response shape; introduces DEFAULT_VECTOR_STORE_NAME.
lib/auth-client.ts Uses public env vars for One Tap; adds helper wrappers; keeps credentials: 'include'.
app/workflows/providers/workflow-context.tsx Adds credentials: 'include' to workflow chat transport.
app/networks/providers/network-context.tsx Adds credentials: 'include' to network chat transport.
app/login/signup/page.tsx Wraps searchParams usage in Suspense and refactors auth client calls.
app/login/page.tsx Wraps searchParams usage in Suspense and refactors auth client calls.
app/chat/workspaces/page.tsx Wraps page in shared chat shell and fixes workspace list consumption.
app/chat/workflows/page.tsx Wraps page in shared chat shell.
app/chat/workflows/[workflowId]/page.tsx Wraps detail page in shared chat shell.
app/chat/user/sessions/page.tsx Adds modular user settings route (sessions).
app/chat/user/security/page.tsx Adds modular user settings route (security).
app/chat/user/profile/page.tsx Adds modular user settings route (profile).
app/chat/user/page.tsx Converts user settings into an overview landing page.
app/chat/user/layout.tsx Adds shared settings layout using ChatSettingsShell.
app/chat/user/danger-zone/page.tsx Adds modular user settings route (danger-zone).
app/chat/user/api-keys/page.tsx Adds modular user settings route (api-keys).
app/chat/user/_components/user-settings-panel.tsx Adds section-based rendering for modular settings routes.
app/chat/tools/page.tsx Wraps page in shared chat shell.
app/chat/providers/chat-context.tsx Provider-metadata parsing hardening + credentials + message validation gating.
app/chat/observability/page.tsx Wraps page in shared chat shell.
app/chat/mcp-a2a/page.tsx Wraps page in shared chat shell.
app/chat/logs/page.tsx Wraps page in shared chat shell.
app/chat/layout.tsx Adds Suspense wrapper around server auth gate.
app/chat/harness/page.tsx Wraps page in shared chat shell.
app/chat/evaluation/page.tsx Wraps page in shared chat shell.
app/chat/dataset/page.tsx Wraps page in shared chat shell.
app/chat/config/agents.ts Updates vector-store wording (no longer PgVector-specific).
app/chat/components/nested-agent-chat.tsx Adds credentials: 'include' to nested-agent transport.
app/chat/components/chat.utils.ts Adds provider-agnostic thought summary extraction.
app/chat/components/chat-sidebar.tsx Adapts to normalized workspaces + vector-store selection; layout tweaks.
app/chat/components/chat-settings-shell.tsx Adds reusable settings shell wrapper for modular settings routes.
app/chat/components/chat-page-shell.tsx Adds hideHeader option and spacing tweaks.
app/chat/components/chat-messages.tsx Provider-metadata parsing hardening + message validation gating.
app/chat/components/chat-layout.tsx Makes chat sidebar resizable and improves layout constraints.
app/chat/admin/users/page.tsx Adds modular admin settings route (users).
app/chat/admin/runtime/page.tsx Adds modular admin settings route (runtime).
app/chat/admin/page.tsx Converts admin settings into an overview landing page.
app/chat/admin/layout.tsx Adds shared settings layout using ChatSettingsShell.
app/chat/admin/_components/admin-management-panel.tsx Adds section-based rendering for modular admin settings routes.
app/chat/AGENTS.md Documents new modular settings shell + workspace hook normalization.
README.md Adds new screenshot to development section.
.gitignore Updates ignore patterns for various local artifacts.
.env.example Updates Better Auth + Google callback/public env examples.
Comments suppressed due to low confidence (1)

app/login/page.tsx:61

  • The login page still writes REMEMBERED_IDENTIFIER_KEY, but the effect that restores the saved identifier from localStorage was removed. This breaks the "remember identifier" UX (users won't see their saved identifier prefilled). Re-add a useEffect that reads window.localStorage.getItem(REMEMBERED_IDENTIFIER_KEY) on mount and updates identifier/rememberIdentifier accordingly.

Comment on lines +19 to +22
.then(createStep(new BatchPartsProcessor(
{ batchSize: 10, emitOnNonText: false },

)))
Comment thread src/mastra/auth.ts
Comment on lines +221 to 223
socialProviders,
baseURL: process.env.BETTER_AUTH_URL ?? 'http://localhost:3000',
secret: process.env.BETTER_AUTH_SECRET ?? 'supersecret',
Comment on lines 49 to 51
},
maxParallelCalls: 5, // Limit parallel embedding calls to avoid rate limits
//maxParallelCalls: 10, // Limit parallel embedding calls to avoid rate limits
providerOptions: {
Comment thread package.json
Comment on lines 259 to 261
"v0-sdk": "^0.16.4",
"zlib-sync": "^0.1.10",
"zod": "^4.3.6"
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces modular route groups for user and admin settings, normalizes workspace data handling, and adds a shared shell for chat-related surfaces. It also hardens chat-provider metadata extraction, fixes hydration mismatches in authentication routes, and introduces a supervisor-pattern scorer for agent evaluation. I have identified a critical issue where the .gitignore file ignores itself, a high-severity issue regarding the incorrect usage of the Pages Router singleton in an App Router project, and a discrepancy between the intended behavior and implementation of the BatchPartsProcessor.

Comment thread .gitignore
.playwright-mcp/page-2026-04-15T08-44-34-033Z.yml
.playwright-mcp/page-2026-04-15T07-36-00-846Z.yml
.playwright-mcp/page-2026-04-15T07-34-28-100Z.yml
.gitignore
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The .gitignore file is configured to ignore itself. This is typically unintended, as it prevents future modifications to this file from being tracked by Git. This could lead to files that should be ignored being accidentally committed in the future. Please consider removing this line.

WrenchIcon,
} from 'lucide-react'
import { cn } from '@/lib/utils'
import router from 'next/router'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

You've imported router from next/router, which is intended for the Pages Router. Since this project uses the App Router, you should use the useRouter hook from next/navigation instead. Using the singleton from next/router is deprecated in the App Router and can lead to unexpected behavior and bugs.

Please remove this import and use useRouter from next/navigation inside the MainSidebar component, as it was before this change.

// Sequential: limit tokens first, then batch stream chunks
.then(createStep(new TokenLimiterProcessor({ limit: 256000 })))
.then(createStep(new BatchPartsProcessor(
{ batchSize: 10, emitOnNonText: false },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a discrepancy between the PR description, which states that the BatchPartsProcessor is 'emitting on non-text', and the code where emitOnNonText is set to false. If the intention is to process non-text parts immediately without batching, this value should be true.

Suggested change
{ batchSize: 10, emitOnNonText: false },
{ batchSize: 10, emitOnNonText: true },

@ssdeanx ssdeanx merged commit 28522e6 into main Apr 15, 2026
102 of 107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants